#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
int a[N];
struct Rect {
  int x, y, d, w;
};
void solve() {
  int x1, y1, x2, y2;
  cin >> n >> m >> x1 >> y1 >> x2 >> y2;
  x2 = max(x1, x2) - min(x1, x2) + 1;
  y2 = max(y1, y2) - min(y1, y2) + 1;
  x1 = y1 = 1;
  int d = n - x2 + 1, w = m - y2 + 1;
  ll area = 2ll * d * w;
  if (d >= x2 && w >= y2) {
    int dd = d + 1 - x2, ww = w + 1 - y2;
    area -= 1ll * dd * ww;
  }
  cout << 1ll * n * m - area << endl;
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}